#ifndef APPLICATION_H
#define APPLICATION_H

#include <QApplication>
#include "appGlobals.h"
class UndoManager;

class MainWindow;
class Document;
namespace Modes { class EditorModeManager; }
class GlobalData;

class Application : public QApplication
{
    Q_OBJECT
public:
    explicit Application(int &argc, char **argv);

    static Application& instance();
    QPointer<Document> document() const;

    bool initInstance();
    void exitInstance();

    QPointer<Document> createDocument();
    void closeDocument();

	QPointer<Modes::EditorModeManager> modeManager() const;
	QPointer<GlobalData> globalData() const;
	QPointer<UndoManager> undoManager() const;
private:
	void initModeManager();
    QPointer<MainWindow> m_mainWindow;
    QPointer<Document> m_document;
	QPointer<Modes::EditorModeManager> m_modeManager;
	QPointer<GlobalData> m_globalData;
	QPointer<UndoManager> m_undoManager;
signals:
    void documentChanged(QPointer<Document> doc);
public slots:

};

#endif // APPLICATION_H
